﻿// This source file is part of the atomdb project
// 
// Copyright (c) 2017 - 2022 pulsarware, All rights reserved.
// Copyright (c) 2017 - 2022 polarboy <polarboy@163.com>
// 
// See https://atomdb.com/LICENSE.txt for license information
// 
// Created by polarboy on 2023/12/01.

using Microsoft.Extensions.DependencyInjection;
using Pulsarware.ATOMDB.Packager.Windows;

namespace Pulsarware.ATOMDB.Packager;

public static class HostServicesConfigurator
{
   public static void AddPackagerServices(this IServiceCollection services)
   {
      services.AddSingleton<StartupService>();
      if (OperatingSystem.IsWindows()) {
         AddServicesForWindows(services);
      }
   }

   private static void AddServicesForWindows(IServiceCollection services)
   {
      services.AddSingleton<IPackager, WindowsPackager>();
      services.AddSingleton<IHostDetector, WindowsHostDetector>();
   }
}